
#include <iostream>

/*==============================
* C语言形式的封装形式
* struct
================================*/

using namespace std;

struct data_t
{
    int year;
    int month;
    int day;
};

void init_data(data_t &dt)
{
    cout<<"year  month  day"<<endl;
    cin>>dt.year>>dt.month>>dt.day;
}

void myprintf(data_t &dt)
{
    cout<<"year month day"<<endl;
    cout<<dt.year<<":"<<dt.month<<":"<<dt.day<<endl;
}

bool isleap_year(data_t &dt)
{
    if((dt.year%4 == 0 && dt.year%100 != 0) || (dt.year%400 == 0))
        return true;
    else
        return false;
}

int main(void)
{
    data_t data;
    
    init_data(data);
    myprintf(data);
    
    if(isleap_year(data))
        cout<<"leap year"<<endl;
    else
        cout<<"not leap year"<<endl;
    
    return 0;
}


